#ifndef UGAMESTATE
#define UGAMESTATE
#include "../stdafx.h"
#include <boost/multi_array.hpp>
#include "UTerrain.h"
#include "../UVector.h"

typedef TUnitOrBuilding* Occupation; //UnitorBuilding pointer, null
typedef boost::multi_array<Occupation, 2> TOccupationMap;

class TGameState
{
private:
	TBuildingTypeVector* BuildingTypes; //Types of buildings that players can buid
	TUnitTypeVector    * UnitTypes;		//types of units that players can build
	
	TTerrainRef Terrain; //destribes the terrain of a game.
	
	TOccupationMap OccupationMap;

	std::vector<TBuilding*> Buildings;

	bool IsFree(int X, int Y);
	int Width()  {return Terrain->Width(); }
	int Height() {return Terrain->Height();}
public:
	TGameState(std::string Name, TBuildingTypeVector*  buildingtypes, TUnitTypeVector* unittypes);
	void BuildBuilding(TBuildingType* type, int PosX, int PosY, float PosZ);
	void Draw();
	TTerrainRefConst GetTerrain()const{return Terrain;};
};

#endif
